<?xml version="1.0" encoding="UTF-8"?>    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">
<f:view>
<h:head>
</h:head>
<h:body>
<h:form id="mainQuestionForm">
	<div id="questionIn">
			
            <div class="clear"></div>
            <h:panelGrid columns="1" footerClass="question-footer">
            	<h:panelGroup><h1>亲爱的顾客，为了使您的问题能够更好更及时的得到回复，请先选择咨询类型：</h1>
                <h:selectOneRadio id="consultationTypeRadio" value="#{detailShoesMainPage.consultation.typeCode}" style="float:left;font-size:12px"><f:selectItems value="#{existConsultationType.consultationTypeItems}"></f:selectItems><f:ajax event="click" execute="@this" render="consultationTypeRadio saveQuestionLink"></f:ajax></h:selectOneRadio>
                </h:panelGroup>
                <h:panelGroup>
                	<h:inputTextarea id="commentQestion" value="#{detailShoesMainPage.consultation.content}" styleClass="question-textarea" rows="10" onkeyup="this.value = this.value.substring(0, 499);"><f:ajax event="keyup" execute="@this" render="saveQuestionLink"></f:ajax></h:inputTextarea>
                </h:panelGroup>
                <h:panelGroup>
	            	<h:outputLabel value="#{msgs['input.verifychar.display']}:" styleClass="normallabel"></h:outputLabel>
	            	<h:inputText id="verifyCodeInput" value="#{detailShoesMainPage.verifyCode}" styleClass="verify-input-text" maxlength="10"><f:ajax event="keyup" execute="@this" render="verifyCodeInput saveQuestionLink"></f:ajax></h:inputText>
		            <p:graphicText id="verifyCode" value="#{detailShoesMainPage.verifyCodeForQuestion}" fontName="Courier New" fontStyle="bold" fontSize="18" styleClass="verify-text"></p:graphicText>
		            <a4j:commandLink id="getOtherVerifyCodeLink" action="#{detailShoesMainPage.generateVerifyCode }" event="click" execute="@this" render="verifyCode verifyCodeInput saveQuestionLink"><h:outputLabel value="#{msgs['verifychar.generate.again.display']}" styleClass="normallabel"></h:outputLabel></a4j:commandLink>
	            </h:panelGroup>
	            <f:facet name="footer">
	            	<a4j:commandLink id="saveQuestionLink" action="#{detailShoesMainPage.saveConsultation}" render="verifyCode saveQuestionLink" value="#{msgs['button.submit.display']}" styleClass="action-link" style="width:120px;" onclick="javascript:if (#{empty detailShoesMainPage.consultation.typeCode}) {alert('#{msgs['question.type.must.select.display']}');return false;} else if (#{empty detailShoesMainPage.consultation.content }) {alert('#{msgs['question.content.must.input.display'] }');return false;}else if(#{empty detailShoesMainPage.verifyCode}) {alert('#{msgs['question.verify.must.input.display'] }');return false;} else if ('#{detailShoesMainPage.verifyCode}'.toUpperCase( ) != '#{detailShoesMainPage.verifyCodeForQuestion }') {alert('#{msgs['verify.char.not.match.display']}');return false;}" oncomplete="javascript:if (#{not empty detailShoesMainPage.saveOutMessage }) {alert('#{detailShoesMainPage.saveOutMessage }');}">
            			<f:param name="code" value="#{code }"></f:param>
            			<f:param name="name" value="#{name }"></f:param>
            			<f:param name="primaryCategoryCode" value="#{primaryCategoryCode }"></f:param>
            			<f:param name="secondCategoryCode" value="#{secondCategoryCode }"></f:param>
            			<f:param name="productId" value="#{productId }"></f:param>
          			</a4j:commandLink>
	            </f:facet>
            
            </h:panelGrid>
        </div>

</h:form>
</h:body>
</f:view>
</html>
